


* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: Arial, sans-serif;
    height: 100vh;
    overflow: visible;
}

.container {
    display: flex;
    height: 100vh;
    background-color: #f5f5f5;
    overflow: visible;
}

/* 左侧面板样式 */
.left-panel {
    width: 38.2%;
    background-color: #ffffff;
    border-right: 2px solid #dcdcdc;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    min-width: 500px;
    height: 100%;
    overflow-y: auto;
}

.agent-info {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 20px;
}

.agent-info h3 {
    font-size: 16px;
    color: #333;
    margin-bottom: 6px;
}

.agent-info input[type="text"] {
    padding: 12px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    background-color: #fafafa;
    transition: all 0.3s ease;
    margin-bottom: 10px;
}

.agent-info input[type="text"]:focus {
    border-color: #1a73e8;
    background-color: #ffffff;
    outline: none;
}

.agent-info textarea {
    height: 100px;
    padding: 12px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    resize: none;
    font-size: 14px;
    line-height: 1.5;
    background-color: #fafafa;
    transition: all 0.3s ease;
}

.agent-info textarea:focus {
    border-color: #1a73e8;
    background-color: #ffffff;
    outline: none;
}

.system-prompt {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.system-prompt textarea {
    height: 150px;
    padding: 12px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    resize: none;
    font-size: 14px;
    line-height: 1.5;
    background-color: #fafafa;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.system-prompt textarea:focus {
    border-color: #1a73e8;
    background-color: #ffffff;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    outline: none;
}

.tools-section {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.tool-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.top-bar > div {
    display: flex;
    gap: 10px;
    align-items: center;
}

.tool-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* 工具选择器样式 */
.category-header {
    padding: 8px 12px;
    margin: 8px 0 4px 0;
    background-color: #f5f5f5;
    border-radius: 4px;
    font-weight: bold;
    color: #555;
}

.tool-item {
    display: flex;
    align-items: center;
    padding: 12px;
    margin: 4px 0;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    background-color: #fafafa;
    transition: all 0.3s ease;
}

.tool-item:hover {
    border-color: #1a73e8;
    background-color: #f8f9fa;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.tool-icon {
    margin-right: 8px;
    font-size: 1.2em;
    width: 24px;
    height: 24px;
}

.tool-name {
    font-weight: 500;
    margin-right: 8px;
}

.tool-desc {
    display: none;
}

.tool-item:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    left: 0;
    top: -10px;
    transform: translateY(-100%);
    background-color: #333;
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 0.9em;
    white-space: normal;
    max-width: 300px;
    width: max-content;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s ease;
    z-index: 100;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    line-height: 1.4;
}

.tool-item {
    position: relative;
}

.tool-item:hover::after {
    opacity: 1;
}

.tool-search {
    width: 100%;
    padding: 8px 12px;
    margin-bottom: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-sizing: border-box;
}

.tool-item label {
    margin-left: 8px;
    flex-grow: 1;
    cursor: pointer;
}

.tool-settings {
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: background-color 0.3s ease;
}

.tool-settings:hover {
    background-color: #e8f0fe;
}

/* 右侧面板样式 */
.right-panel {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    background-color: #ffffff;
    height: 100%;
    overflow-y: auto;
}

.top-bar {
    padding: 10px 20px;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    justify-content: flex-end;
}

.save-button,.add-button,.generate-button,.delete-button {
    padding: 10px 24px;
    background-color: #4CAF50;
    color: white;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
    letter-spacing: 0.5px;
}

.save-button:hover,.add-button:hover,.generate-button:hover {
    background-color: #3d8b40;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.delete-button {
    background-color: #f44336;
    margin-left: 10px;
}

.delete-button:hover {
    background-color: #d32f2f;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.prompt-container {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.prompt-container textarea {
    flex: 1;
    min-height: 100px;
}

.prompt-container .generate-button {
    width: 80px;
    height: 40px;
    margin-left: 10px;
}

.chat-display {
    flex-grow: 1;
    padding: 20px;
    overflow-y: auto;
    border-bottom: 1px solid #e0e0e0;
}

.chat-input {
    min-height: 56px;
    max-height: 240px;
    padding: 8px 16px;
    display: flex;
    gap: 8px;
    background-color: #ffffff;
    align-items: center;
    border-top: 1px solid #f0f0f0;
}

.chat-input textarea {
    flex-grow: 1;
    padding: 8px 12px;
    border: 1px solid #e0e0e0;
    border-radius: 20px;
    resize: none;
    font-size: 14px;
    line-height: 1.5;
    background-color: #f8f9fa;
    transition: all 0.3s ease;
    min-height: 40px;
    max-height: 200px;
    overflow-y: auto;
}

.chat-input textarea:focus {
    border-color: #4285f4;
    background-color: #ffffff;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    outline: none;
}

.chat-input button {
    width: 48px;
    height: 40px;
    padding: 0;
    background-color: #4285f4;
    color: white;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    font-size: 20px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chat-input button:hover {
    background-color: #1a73e8;
}

/* 聊天消息样式 */
.message {
    margin-bottom: 16px;
    padding: 12px 16px;
    border-radius: 12px;
    max-width: 80%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    opacity: 0;
    transform: translateY(10px);
    animation: messageFadeIn 0.3s ease forwards;
}

@keyframes messageFadeIn {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.user-message {
    background-color: #e3f2fd;
    margin-left: auto;
}

.agent-message {
    background-color: #f5f5f5;
    margin-right: auto;
}

.agent-message.success {
    background-color: #e8f5e9;
    border-left: 4px solid #4CAF50;
    color: #2e7d32;
}

.agent-message.error {
    background-color: #ffebee;
    border-left: 4px solid #f44336;
    color: #c62828;
}

/* 保存按钮加载状态 */
.save-button[disabled] {
    background-color: #bdbdbd !important;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

/* 工具选择器样式 */
.tools-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.add-tool-btn {
    width: 28px;
    height: 28px;
    border-radius: 14px;
    background-color: #4285f4;
    color: white;
    border: none;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.add-tool-btn:hover {
    background-color: #1a73e8;
    transform: scale(1.1);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

/* 模态框通用样式 */
.modal, .tool-selector-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    background-color: white;
    border-radius: 12px;
    width: 80%;
    max-width: 500px;
    max-height: 80vh;
    overflow-y: auto;
    padding: 20px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    animation: modalFadeIn 0.3s ease;
    position: relative;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.close-modal {
    font-size: 24px;
    cursor: pointer;
    transition: color 0.3s ease;
    float: right;
}

.close-modal:hover {
    color: #1a73e8;
}

/* 工具选择器样式 */
.tool-selector-list {
    margin: 20px 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-height: 60vh;
    scrollbar-width: thin;
    scrollbar-color: #4285f4 #f5f5f5;
    padding: 8px;
    padding-right: 120px; /* 为右侧按钮留出空间 */
}

.tool-selector-list::-webkit-scrollbar {
    width: 8px;
}

.tool-selector-list::-webkit-scrollbar-track {
    background: #f5f5f5;
    border-radius: 4px;
}

.tool-selector-list::-webkit-scrollbar-thumb {
    background-color: #4285f4;
    border-radius: 4px;
}

/* 工具项通用样式 */
.tool-item, 
.tool-selector-list .tool-item {
    display: flex;
    align-items: center;
    padding: 12px;
    background: #f9f9f9;
    border-radius: 6px;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.tool-item:hover, 
.tool-selector-list .tool-item:hover {
    background: #f0f0f0;
    box-shadow: 0 3px 6px rgba(0,0,0,0.16), 0 3px 6px rgba(0,0,0,0.23);
}

.tool-item input[type="checkbox"],
.tool-selector-list input[type="checkbox"] {
    margin-right: 10px;
    transform: scale(1.2);
    accent-color: #4285f4;
}

/* 按钮通用样式 */
.add-tool-btn {
    padding: 8px 16px;
    background: #4285f4;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.add-tool-btn:hover {
    background: #1a73e8;
}

.confirm-selection {
    padding: 10px 20px;
    background: #34a853;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
    position: absolute;
    right: 20px;
    bottom: 20px;
    width: auto;
    min-width: 100px;
    z-index: 10;
}

.confirm-selection:hover {
    background: #2d8e47;
}

.error-message {
    padding: 16px;
    background: #ffebee;
    border-radius: 8px;
    color: #c62828;
    text-align: center;
}

.error-message p {
    margin-bottom: 12px;
}

.retry-btn {
    padding: 8px 16px;
    background: #4285f4;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
}

.retry-btn:hover {
    background: #3367d6;
}

/* 加载状态 */
.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255,255,255,0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
    margin-right: 8px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-text {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
